<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="{:U('Index/index')}" data-original-title="首页"><i class="icon-home"></i> 首页</a>
			<a class="current" href="{$post_url}">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
						<h5>{$meta_title}</h5>
					</div>
					<div class="widget-content nopadding form-horizontal search-form">
						<div class="control-group" style="line-height:37px;">
							<label class="control-label"><button class="btn btn-info btn-focus">扫描纸质订单</button></label>
							<div class="controls">
								<input type="text" placeholder="纸质订单号" class="ui-wizard-content search-input" name="order_number" id="order_number" value="{:strip_tags(I('order_number'))}"  autocomplete="off" ><button class="btn btn-info" id="search_button" url="{:U('Order/refund')}"><i class="icon-search icon-white"></i></button>
							</div>
							<div class="controls">
								<if condition="$order neq null">
									<volist name="order" id="vo">
										<span class="help-block blue" id="order_number_help" style="float:left; width:260px; margin-right:20px; font-size:16px;" >
											活动名称：<font color="red"><b>{$vo.activity_id|getActivityName}</b></font><br>
											订单类型：<font color="red"><b>{$vo.order_type|get_order_type_title}</b></font><br>
											订单号码：{$vo.order_id}<br>
											商户名称：{$vo.merchant_id|getMerchantName}<br>
											品类名称：{$vo.conf_category_id|getConfCategoryName}<br>
											店铺名称：{$vo.shop_id|getShopName}<br>
											客户手机：{$vo.customer_id|getCustomerName}<br>
											订单金额：{$vo.order_amount}<br>
											是否换礼：<b>{$gift_info}</b><br>
											<if condition="$vo.coupons_type eq 1"><font color="#f60">优惠券金额：{$vo.coupons_amount} 元</font></if>
										</span>
									</volist>
								</if>
							</div>
						</div>
						<notempty name="payment_list">
							<div class="control-group">
								<div class="widget-content span10">
									<table class="table table-striped">
										<thead>
											<tr>
												<th nowrap="nowrap">编号</th>
												<th>支付时间</th>
												<th>支付方式</th>
												<th>支付金额</th>
												<th>操作</th>
											</tr>
											<volist name="payment_list" id="vo">
												<if condition="$vo['pay_type'] eq 9"><tr style="background-color:#FFD2D2;"><else /><tr></if>
													<td style="height:23px;" class="taskStatus">{$i}</td>
													<td class="taskStatus">{$vo.create_time|time_format}</td>
													<td class="taskStatus"><if condition="($vo['pay_type'] egt 3) and ($vo['pay_type'] elt 7)"><font color="red">[线上]</font></if>{$vo.pay_type|get_pay_title}</td>
													<td class="taskStatus">{$vo.amount}</td>
													<td nowrap="nowrap" class="taskStatus">
													<if condition="$vo['type'] eq 1">
														<if condition="($vo['pay_type'] egt 3) and ($vo['pay_type'] elt 7)">
															<button class="btn btn-warning btn-mini" type="button" onclick="print_apply('{$vo.order_id}','{$vo.payment_id}')">申请退款</button>
														<else/>
															<button class="btn btn-danger btn-mini" type="button" onclick="print_('{$vo.order_id}','{$vo.payment_id}')">退 款</button>
														</if>
													<else/>
														<font color="green">已退款</font>
													</if>
													</td>
												</tr>
											</volist>
										</thead>
									</table>
								</div>
							</div>
						</notempty>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
function print_(oid,pid){
	if(oid == 0 || pid == 0){
		tke_alert('order_id/payment_id参数错误', 'alert-error', 2000);
		return false;
	}
	var obj = window.open("__APP__/Order/printRefund/order_id/" + oid + "/payment_id/" + pid ,"_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes");
}
function print_apply(oid,pid){
	if(oid == 0 || pid == 0){
		tke_alert('order_id/payment_id参数错误', 'alert-error', 2000);
		return false;
	}
	var obj = window.open("__APP__/Order/printApplyRefund/order_id/" + oid + "/payment_id/" + pid ,"_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes");
}
$(document).ready(function(){
	//焦点纸质订单号
	$('#order_number').focus();
	
	$('.btn-focus').click(function(){
		$(this).parent().parent().find('input').val('');
		$(this).parent().parent().find('input').focus();
	})
	//导航高亮
	highlight_subnav("{:U('Order/refund')}");
});
</script>
</block>